package com.hspedu.newData.dmsxl.滑动窗口;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

/**
 * @Author: yh
 * @description: 
 * @CreateTime: 2025-04-29 
 * @Version: 1.0
 */

public class LC2176统计数组中相等且可以被整除的数对 {

    public int countPairs(int[] nums, int k) {

        int count = 0;
        for (int i = 0; i < nums.length; i++) {
            for (int j = i + 1; j < nums.length; j++) {
                if (nums[i] == nums[j] && i*j%k == 0){
                    count++;
                }
            }
        }
        return count;
    }
}
